//package coma.dou.dema;
//
//import com.solidfire.gson.Gson;
//
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//import java.util.stream.Collectors;
//
//public class Demo {
//    public static void main(String[] args) {
////        method1();
//
//        List<Good> goods = new ArrayList<>();
//        Good good1 = new Good(1L,"10","江苏","100","南京", "1000", "江陵");
//        goods.add(good1);
//        Good good2 = new Good(1L,"10","江苏","100","南京", "1001", "六合");
//        goods.add(good2);
//        Good good3 = new Good(1L,"10","江苏","101","苏州", "1000", "江阴");
//        goods.add(good3);
//        Good good4 = new Good(1L,"10","江苏","101","苏州", "1001", "昆山");
//        goods.add(good4);
//        Good good5 = new Good(1L,"11","浙江","100","杭州", "1000", "上城区");
//        goods.add(good5);
//
//
//        List<Tree> list = new ArrayList<>();
//
//        for (Good good : goods) {
//            list.add(new Tree(1, good.getCode1(), "", good.getName1()));
//            list.add(new Tree(2, good.getCode2(), good.getCode1(), good.getName2()));
//            list.add(new Tree(3,good.getCode3(), good.getCode2(), good.getName3()));
//        }
//
//        System.out.println(list);
//
//
//
//
//
//
//
//
////
////
////
////        Map<String, Map<String, Map<String, List<Good>>>> groupedGoods = goods.stream()
////                .collect(Collectors.groupingBy(Good::getCode1,
////                        Collectors.groupingBy(Good::getCode2,
////                                Collectors.groupingBy(Good::getCode3))));
////
////
////
////        Map<Tree, Map<Tree, Map<Tree, List<Tree>>>> trees = new HashMap<>();
////        trees.keySet();
////
////
////
////
////
////        String json = new Gson().toJson(groupedGoods);
////
////
////
////        System.out.println(json);
//
//
//        List<Tree> treeList = new ArrayList<>();
//
//// Loop through the groupedGoods map to create the tree structure
////        method2(groupedGoods, treeList);
//
//    }
//
//
//
//
//
//
////
////    private static void method2(Map<String, Map<String, Map<String, List<Good>>>> groupedGoods, List<Tree> treeList) {
////        for (Map.Entry<String, Map<String, Map<String, List<Good>>>> provinceEntry : groupedGoods.entrySet()) {
////            String provinceName = provinceEntry.getKey();
////            Map<String, Map<String, List<Good>>> cityMap = provinceEntry.getValue();
////            Tree provinceNode = new Tree(1, null, provinceName);
////            treeList.add(provinceNode);
////
////            for (Map.Entry<String, Map<String, List<Good>>> cityEntry : cityMap.entrySet()) {
////                String cityName = cityEntry.getKey();
////                Map<String, List<Good>> countyMap = cityEntry.getValue();
////                Tree cityNode = new Tree(2, null, cityName);
////                provinceNode.add(cityNode);
////
////                for (Map.Entry<String, List<Good>> countyEntry : countyMap.entrySet()) {
////                    String countyName = countyEntry.getKey();
////                    Tree countyNode = new Tree(3, null, countyName);
////                    cityNode.addChild(countyNode);
////                }
////            }
////        }
////    }
//
//    private static void method1() {
//        String type = "0";
//        boolean result = result(type);
//        System.out.println(result);
//
//
//        type = "1";
//        result = result(type);
//        System.out.println(result);
//
//
//        type = "";
//        result = result(type);
//        System.out.println(result);
//
//        type = null;
//        result = result(type);
//        System.out.println(result);
//    }
//
//    public static boolean result(String type){
//        if(!("0".equals(type) || "1".equals(type))) {
//            return  false;
//        }
//        return true;
//    }
//}
